home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
cboot.d64
/
polygon.l
< prev
next >
Wrap
Text File
|
2009-01-23
|
493b
|
22 lines
0010 PROC POLYGON(SIDES,RADIUS) CLOSED
0020 //THIS ROUTINE DRAWS A POLYGON
0030 // CENTERED AT THE CURRENT
0040 // POSITION WITH SIDES AND RADIUS
0050 // GIVEN
0060 PI:=3.14159265
0070 LENGTH:=2*RADIUS*SIN(PI/SIDES)
0080 ANGLE:=180*(1-(SIDES-2)/SIDES)
0090 PENUP
0100 FORWARD RADIUS
0110 RIGHT 90+ANGLE/2
0120 PENDOWN
0130 FOR SIDE:=1 TO SIDES DO
0140 FORWARD LENGTH
0150 RIGHT ANGLE
0160 ENDFOR SIDE
0170 RIGHT 90-ANGLE/2
0180 PENUP
0190 FORWARD RADIUS
0200 RIGHT 180
0210 ENDPROC POLYGON